package com.kimehwa.studyboot.partern.Interceptormode.impl;

import com.kimehwa.studyboot.partern.Interceptormode.Interceptor;
import com.kimehwa.studyboot.partern.Interceptormode.Invocation;

/**
 * @author xiaodongguan
 * @description
 * @since 2021-07-27 10:55
 */
public class LogInterceptor implements Interceptor {
    @Override
    public void before(Invocation invocation) {
        System.out.println("LogInterceptor before...");
    }

    @Override
    public String intercept(Invocation invocation) {
        this.before(invocation);
        invocation.invoke();
        this.after(invocation);
        return null;
    }

    @Override
    public void after(Invocation invocation) {
        System.out.println("LogInterceptor after...");
    }
}
